home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / Developer Essentials May91 / MPW Interfaces & Libraries 3.2 / AIncludes / SlotEqu.a < prev    next >
Encoding:
Text File  |  1991-04-17  |  13.2 KB  |  514 lines  |  [TEXT/MPS ]

  1. ; Version: 2.54
  2. ; Created: Thursday, August 3, 1989 at 6:28:07 PM
  3. ;
  4. ; File: SlotEqu.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1986-1990
  8. ; All Rights Reserved
  9. ;
  10. ;--------------------------------------------------------------------
  11.  
  12.     IF &TYPE('__IncludingSlotEqu__') = 'UNDEFINED' THEN
  13. __IncludingSlotEqu__    SET    1
  14.  
  15.  
  16. ; sInfo Array status flags (StatusFlags) in bit numbers
  17.  
  18. fDontUse          equ         0                         ; old slotmgr put fcardIsChanged here
  19. fCardIsChanged    equ         1                         ; card is Changed field in StatusFlags field of sInfoArray
  20. fTempEnabled      equ         2                         ; slot is temporarily enabled
  21.  
  22. ; spBlock flags (spFlags)
  23.  
  24. fCkForNext        EQU         $00                       ; check for NEXT sRsrc in SRT            (SearchSRT)
  25. fCkReserved       EQU         $01                       ; check reserved field for zero         (ReadPBSize)
  26. fWarmStart        EQU         $02                       ; warm start, else cold start            (PrimaryInit)
  27. fClear            EQU         $03                       ; clear the memory                        (sNewPtr)
  28. fSys              EQU         $04                       ; alloc  on system heap                 (sNewPtr)
  29. fConsecBytes      EQU         $05                       ; calc step value for consecutive bytes (CalcStep)
  30.  
  31. ; flag bits for spParamData
  32.  
  33. fAll              EQU         0                         ; bit 0: set=search enabled/disabled sRsrc's
  34. fOneSlot          EQU         1                         ;      1: set=search sRsrc's in given slot only
  35. fNext             EQU         2                         ;      2: set=search for next sRsrc
  36.  
  37. ; sResource flags (sRsrc_Flags) - flags 8-15 are entered into srt flags field
  38.  
  39. fOpenAtStart      EQU         1                         ; open the driver at start time, else do not
  40. f32BitMode        EQU         2                         ; a 32-bit address will be put into dctlDevBase
  41.  
  42. ; state constants for sInfoRecord
  43.  
  44. stateNil          EQU         0                         ; uninitialized sInfoRecord
  45. stateSDMInit      EQU         1                         ; sInfoRecord initialized - executed InitSDeclMgr
  46. statePRAMInit     EQU         2                         ; sPRAM record initialized - executed InitSPRAMRec
  47. statePInit        EQU         3                         ; primary Init executed
  48. stateSInit        EQU         4                         ; secondary init executed
  49.  
  50. ;Misc masks <6>
  51.  
  52. catMask            EQU            $08                        ; sets spCategory field of spTBMask (bit 3)
  53. cTypeMask        EQU            $04                        ; sets spCType    field of spTBMask (bit 2)
  54. drvrSWMask        EQU            $02                        ; sets spDrvrSW   field of spTBMask (bit 1)
  55. drvrHWMask        EQU            $01                        ; sets spDrvrHW      field of spTBMask (bit 0)
  56.  
  57. ;Misc constants
  58.  
  59. sizeSPRAMRec      EQU         8                         ; size of sPRAM record
  60. smPRAMTop         EQU         $46                       ; address of beginning of slot PRAM area
  61. majorSpace        EQU         $90                       ; high byte of beginning of major space
  62.  
  63. TotalSlots        EQU         15                        ; number of slot supported
  64. minorLast         EQU         $FEFFFFFF                 ; last minor slot addr
  65. FirstPRAMSlot     EQU         $9                        ; First slot with PRAM allocated
  66. sNumSlots         EQU         6                         ; used for number of slot interrupts supported on via
  67. sFirstSlot        EQU         $9                        ; First slot supported
  68. sLastSlot         EQU         $E                        ; The last slot.
  69. minorStep         EQU         $01000000                 ; value to step minor address to next slot
  70. retryCnt          EQU         100                       ; default retry cnt on a Nubus read bus error
  71.  
  72. lastSDMSelt       EQU         $3D                       ;The last SDM selector
  73.  
  74. ;
  75. ;    Slot interrupt queue element  -  Used to install a slot interrupt handler by sInitInstall
  76. ;
  77.  
  78. SlotIntQElement   RECORD      0
  79. sqLink            DS.L        1                         ; Ptr - ptr to next element
  80. sqType            DS.W        1                         ; INTEGER - queue type ID for validity
  81. sqPrio            DS.W        1                         ; INTEGER - priority
  82. sqAddr            DS.L        1                         ; ProcPtr - interrupt service routine
  83. sqParm            DS.L        1                         ; LONGINT - optional A1 parameter
  84. sqHDSize          EQU         *                         ; size of slot queue header element
  85.                   ENDR
  86.  
  87. ;
  88. ;    Slot Parameter Block  -  parameter block to all slot manager routines.    All fields
  89. ;    may be inputs, or outputs.
  90. ;
  91.  
  92. SpBlock           RECORD      0
  93. spResult          DS.L        1                         ; result
  94. spSPointer        DS.L        1                         ; general pointer
  95. spSize            DS.L        1                         ; size
  96. spOffsetData      DS.L        1                         ; Offset/Data field value            (sOffsetData)
  97. spIOFileName      DS.L        1                         ; Pointer to IOFile name            (not used)
  98. spSExecPBlk       DS.L        1                         ; Pointer to sExec block
  99. spParamData       DS.L        1                         ; misc parameter data                (formerly spStackPtr)
  100. spMisc            DS.L        1                         ; Misc field for SDM                (not used)
  101. spReserved        DS.L        1                         ; Reserved for future expansion
  102. spIOReserved      DS.W        1                         ; Reserved field of SRT
  103. spRefNum          DS.W        1                         ; RefNum
  104. spCategory        DS.W        1                         ; sResource category
  105. spCType           DS.W        1                         ;            type
  106. spDrvrSW          DS.W        1                         ;            drvrsw
  107. spDrvrHW          DS.W        1                         ;            drvrhw
  108. spTBMask          DS.B        1                         ; type bit mask (bit 0 set = ignore drvrhw, bit 1 = drvrsw, ...)
  109. spSlot            DS.B        1                         ; slot number.
  110. spId              DS.B        1                         ; sResource id
  111. spExtDev          DS.B        1                         ; external device id
  112. spHwDev           DS.B        1                         ; hardware device id
  113. spByteLanes       DS.B        1                         ; bytelanes value from FHeader in the declaration ROM.
  114. spFlags           DS.B        1                         ; general flags
  115. spKey             DS.B        1                         ; reserved                            (not used)
  116. spBlockSize       EQU         *                         ; Size of spBlock
  117.                   ENDR
  118.  
  119. ;
  120. ;    sInfo Record  -  general slot information.    A record exists for each slot
  121.  
  122.  
  123. SInfoRecord       RECORD      0                         ;Slot information record. sInfo Array[1..NumSlots]
  124. siDirPtr          DS.L        1                         ; Pointer to directory
  125. siInitStatusA     DS.W        1                         ; Fundamental Error
  126. siInitStatusV     DS.W        1                         ; Status returned by vendor Init code
  127. siState           DS.B        1                         ; Initialization State (Primary, Secondary)
  128. siCPUByteLanes    DS.B        1                         ; CPU Byte Lanes. Each bit set signifies a byte-lane used.
  129. siTopOfROM        DS.B        1                         ; Top of ROM = $FssFFFFx, where x is TopOfROM.
  130. siStatusFlags     DS.B        1                         ; Bit-0:Card is changed
  131. siTOConst         DS.W        1                         ; Time Out Constant for BusErr
  132. siReserved        DS.B        2                         ; Reserved, must be 0
  133. sInfoRecSize      EQU         *                         ; Size of sInfoRecord
  134. siROMAddr         DS.L        1                         ; Address of top of ROM (major or minor space)
  135. siSlot            DS.B        1                         ; slot number
  136. siPadding         DS.B        3                         ; padding to bring out to next long
  137. sInfoNewSize      EQU         *                         ; size of new sInfo record
  138.                   ENDR
  139.  
  140. FHeaderRec        RECORD      0
  141. fhDirOffset       DS.L        1                         ;Offset to directory
  142. fhLength          DS.L        1                         ;Length of ROM
  143. fhCRC             DS.L        1                         ;CRC
  144. fhROMRev          DS.B        1                         ;Revision of ROM
  145. fhFormat          DS.B        1                         ;Format-2
  146. fhTstPat          DS.L        1                         ;TestPattern
  147. fhReserved        DS.B        1                         ;Reserved
  148. fhByteLanes       DS.B        1                         ;ByteLanes
  149. fhBlockSize       EQU         *
  150.                   ENDR
  151.  
  152. OffsetToDir       EQU         FHeaderRec.fhDirOffset-FHeaderRec.fhBlockSize+1
  153.                                                         ; offset to dir ptr
  154.  
  155. SEBlock           RECORD      0                         ;Parameter block for code executed by sExec.
  156. ;------- elements of all seBlocks ------
  157. seSlot            DS.B        1                         ; Slot number.
  158. seSRsrcId         DS.B        1                         ; sResource Id.
  159. seStatus          DS.W        1                         ; Status of code executed by sExec.
  160. seFlags           DS.B        1                         ; Flags.
  161. seFiller          DS.B        3                         ; Filler
  162. ;------- extensions for sLoad + sBoot ------
  163. seResult          DS.L        1                         ; Result of sLoad.
  164. seIOFileName      DS.L        1                         ; Pointer to IOFile name.
  165. seDevice          DS.B        1                         ; Which device to read from.
  166. sePartition       DS.B        1                         ; The partition.
  167. seOSType          DS.B        1                         ; Type of OS.
  168. seReserved        DS.B        1                         ; Reserved field.
  169. seRefNum          DS.B        1                         ; RefNum of the driver.
  170. ;------- extensions for sBoot ------
  171. seNumDevices      DS.B        1                         ; Number of devices to load.
  172. seBootState       DS.B        1                         ; State of StartBoot code.
  173.                   ALIGN       2
  174. seBlockSize       EQU         *                         ; Size of se parameter Block
  175.                   ENDR
  176.  
  177. ; Slot Manager Selectors:
  178. ;
  179. ; PRINCIPLE
  180.  
  181. sReadByte         EQU         $00
  182. sReadWord         EQU         $01
  183. sReadLong         EQU         $02
  184. sGetCString       EQU         $03
  185. sGetBlock         EQU         $05
  186. sFindStruct       EQU         $06
  187. sReadStruct       EQU         $07
  188. sVersion          EQU         $08
  189. sSetSRsrcState    EQU         $09
  190. sInsertSRTRec     EQU         $0A
  191. sGetSRsrc         EQU         $0B
  192. sGetTypeSRsrc     EQU         $0C
  193.  
  194. ; SPECIAL
  195. sReadInfo         EQU         $10
  196. sReadPRAMRec      EQU         $11
  197. sPutPRAMRec       EQU         $12
  198. sReadFHeader      EQU         $13
  199. sNextSRsrc        EQU         $14
  200. sNextTypeSRsrc    EQU         $15
  201. sRsrcInfo         EQU         $16
  202. sDisposePtr       EQU         $17
  203. sCkCardStat       EQU         $18
  204. sReadDrvrName     EQU         $19
  205. sFindSRTRec       EQU         $1A
  206. sFindDevBase      EQU         $1B
  207. sFindBigDevBase    EQU         $1C
  208. sGetSRsrcPtr      EQU         $1D
  209.  
  210. ; Advanced
  211. initSDeclMgr      EQU         $20
  212. sPrimaryInit      EQU         $21
  213. sCardChanged      EQU         $22
  214. sExec             EQU         $23
  215. sOffsetData       EQU         $24
  216. sInitPRAMRecs     EQU         $25
  217. sReadPBSize       EQU         $26
  218.  
  219. sCalcStep         EQU         $28
  220. sInitSRsrcTable    EQU         $29
  221. sSearchSRT        EQU         $2A
  222. sUpdateSRT        EQU         $2B
  223. sCalcSPointer     EQU         $2C
  224. sGetDriver        EQU         $2D
  225. sPtrToSlot        EQU         $2E
  226. sFindSInfoRecPtr EQU         $2F
  227. sFindSRsrcPtr     EQU         $30
  228. sDeleteSRTRec     EQU         $31
  229. sSecondaryInit    EQU         $32
  230. sInitSlotPRAM     EQU         $33
  231.  
  232.  
  233. ;#####################################################################
  234. ; PRINCIPLE
  235. ;#####################################################################
  236.  
  237.                   MACRO
  238.                   _SReadByte
  239.                   MOVEQ       #sReadByte,D0
  240.                   _SlotManager
  241.                   ENDM
  242.  
  243.                   MACRO
  244.                   _SReadWord
  245.                   MOVEQ       #sReadWord,D0
  246.                   _SlotManager
  247.                   ENDM
  248.  
  249.                   MACRO
  250.                   _SReadLong
  251.                   MOVEQ       #sReadLong,D0
  252.                   _SlotManager
  253.                   ENDM
  254.  
  255.                   MACRO
  256.                   _SGetCString
  257.                   MOVEQ       #sGetCString,D0
  258.                   _SlotManager
  259.                   ENDM
  260.  
  261.                   MACRO
  262.                   _SGetBlock
  263.                   MOVEQ       #sGetBlock,D0
  264.                   _SlotManager
  265.                   ENDM
  266.  
  267.                   MACRO
  268.                   _SFindStruct
  269.                   MOVEQ       #sFindStruct,D0
  270.                   _SlotManager
  271.                   ENDM
  272.  
  273.                   MACRO
  274.                   _SReadStruct
  275.                   MOVEQ       #sReadStruct,D0
  276.                   _SlotManager
  277.                   ENDM
  278.  
  279.                   MACRO
  280.                   _SVersion
  281.                   MOVEQ       #sVersion,D0
  282.                   _SlotManager
  283.                   ENDM
  284.  
  285.                   MACRO
  286.                   _SetSRsrcState
  287.                   MOVEQ       #sSetSRsrcState,D0
  288.                   _SlotManager
  289.                   ENDM
  290.  
  291.                   MACRO
  292.                   _InsertSRTRec
  293.                   MOVEQ       #sInsertSRTRec,D0
  294.                   _SlotManager
  295.                   ENDM
  296.  
  297.                   MACRO
  298.                   _GetSRsrc
  299.                   MOVEQ       #sGetSRsrc,D0
  300.                   _SlotManager
  301.                   ENDM
  302.  
  303.                   MACRO
  304.                   _GetTypeSRsrc
  305.                   MOVEQ       #sGetTypeSRsrc,D0
  306.                   _SlotManager
  307.                   ENDM
  308.  
  309.  
  310. ;#####################################################################
  311. ; SPECIAL
  312. ;#####################################################################
  313.                   MACRO
  314.                   _SReadInfo
  315.                   MOVEQ       #sReadInfo,D0
  316.                   _SlotManager
  317.                   ENDM
  318.  
  319.                   MACRO
  320.                   _SReadPRAMRec
  321.                   MOVEQ       #sReadPRAMRec,D0
  322.                   _SlotManager
  323.                   ENDM
  324.  
  325.                   MACRO
  326.                   _SPutPRAMRec
  327.                   MOVEQ       #sPutPRAMRec,D0
  328.                   _SlotManager
  329.                   ENDM
  330.  
  331.                   MACRO
  332.                   _SReadFHeader
  333.                   MOVEQ       #sReadFHeader,D0
  334.                   _SlotManager
  335.                   ENDM
  336.  
  337.                   MACRO
  338.                   _SNextSRsrc
  339.                   MOVEQ       #sNextSRsrc,D0
  340.                   _SlotManager
  341.                   ENDM
  342.  
  343.                   MACRO
  344.                   _SNextTypeSRsrc
  345.                   MOVEQ       #sNextTypeSRsrc,D0
  346.                   _SlotManager
  347.                   ENDM
  348.  
  349.                   MACRO
  350.                   _SRsrcInfo
  351.                   MOVEQ       #sRsrcInfo,D0
  352.                   _SlotManager
  353.                   ENDM
  354.  
  355.                   MACRO
  356.                   _SDisposePtr
  357.                   MOVEQ       #sDisposePtr,D0
  358.                   _SlotManager
  359.                   ENDM
  360.  
  361.                   MACRO
  362.                   _SCkCardStat
  363.                   MOVEQ       #sCkCardStat,D0
  364.                   _SlotManager
  365.                   ENDM
  366.  
  367.                   MACRO
  368.                   _SReadDrvrName
  369.                   MOVEQ       #sReadDrvrName,D0
  370.                   _SlotManager
  371.                   ENDM
  372.  
  373.                   MACRO
  374.                   _FindSRTRec
  375.                   MOVEQ       #sFindSRTRec,D0
  376.                   _SlotManager
  377.                   ENDM
  378.  
  379.                   MACRO
  380.                   _SFindDevBase
  381.                   MOVEQ       #sFindDevBase,D0
  382.                   _SlotManager
  383.                   ENDM
  384.  
  385.                   MACRO
  386.                   _SFindBigDevBase
  387.                   MOVEQ       #sFindBigDevBase,D0
  388.                   _SlotManager
  389.                   ENDM
  390.  
  391.                   MACRO
  392.                   _GetSRsrcPtr
  393.                   MOVEQ       #sGetSRsrcPtr,D0
  394.                   _SlotManager
  395.                   ENDM
  396.  
  397. ;#####################################################################
  398. ; Advanced
  399. ;#####################################################################
  400.                   MACRO
  401.                   _InitSDeclMgr
  402.                   MOVEQ       #initSDeclMgr,D0
  403.                   _SlotManager
  404.                   ENDM
  405.  
  406.                   MACRO
  407.                   _SPrimaryInit
  408.                   MOVEQ       #sPrimaryInit,D0
  409.                   _SlotManager
  410.                   ENDM
  411.  
  412.                   MACRO
  413.                   _SCardChanged
  414.                   MOVEQ       #sCardChanged,D0
  415.                   _SlotManager
  416.                   ENDM
  417.  
  418.                   MACRO
  419.                   _SExec
  420.                   MOVEQ       #sExec,D0
  421.                   _SlotManager
  422.                   ENDM
  423.  
  424.                   MACRO
  425.                   _SOffsetData
  426.                   MOVEQ       #sOffsetData,D0
  427.                   _SlotManager
  428.                   ENDM
  429.  
  430.                   MACRO
  431.                   _SInitPRAMRecs
  432.                   MOVEQ       #sInitPRAMRecs,D0
  433.                   _SlotManager
  434.                   ENDM
  435.  
  436.                   MACRO
  437.                   _SReadPBSize
  438.                   MOVEQ       #sReadPBSize,D0
  439.                   _SlotManager
  440.                   ENDM
  441.  
  442.                   MACRO
  443.                   _SCalcStep
  444.                   MOVEQ       #sCalcStep,D0
  445.                   _SlotManager
  446.                   ENDM
  447.  
  448.                   MACRO
  449.                   _SInitSRsrcTable
  450.                   MOVEQ       #sInitSRsrcTable,D0
  451.                   _SlotManager
  452.                   ENDM
  453.  
  454.                   MACRO
  455.                   _SSearchSRT
  456.                   MOVEQ       #sSearchSRT,D0
  457.                   _SlotManager
  458.                   ENDM
  459.  
  460.                   MACRO
  461.                   _SUpdateSRT
  462.                   MOVEQ       #sUpdateSRT,D0
  463.                   _SlotManager
  464.                   ENDM
  465.  
  466.                   MACRO
  467.                   _SCalcSPointer
  468.                   MOVEQ       #sCalcSPointer,D0
  469.                   _SlotManager
  470.                   ENDM
  471.  
  472.                   MACRO
  473.                   _SGetDriver
  474.                   MOVEQ       #sGetDriver,D0
  475.                   _SlotManager
  476.                   ENDM
  477.  
  478.                   MACRO
  479.                   _SPtrToSlot
  480.                   MOVEQ       #sPtrToSlot,D0
  481.                   _SlotManager
  482.                   ENDM
  483.  
  484.                   MACRO
  485.                   _SFindSInfoRecPtr
  486.                   MOVEQ       #sFindSInfoRecPtr,D0
  487.                   _SlotManager
  488.                   ENDM
  489.  
  490.                   MACRO
  491.                   _SFindSRsrcPtr
  492.                   MOVEQ       #sFindSRsrcPtr,D0
  493.                   _SlotManager
  494.                   ENDM
  495.  
  496.                   MACRO
  497.                   _SDeleteSRTRec
  498.                   MOVEQ       #sDeleteSRTRec,D0
  499.                   _SlotManager
  500.                   ENDM
  501.  
  502.                   MACRO
  503.                   _SecondaryInit
  504.                   MOVEQ       #sSecondaryInit,D0
  505.                   _SlotManager
  506.                   ENDM
  507.  
  508.                   MACRO
  509.                   _InitSlotPRAM
  510.                   MOVEQ       #sInitSlotPRAM,D0
  511.                   _SlotManager
  512.                   ENDM
  513.  
  514.     ENDIF    ; ...already included